Widen float32 tolerance for TestRotatedBoxIou::test_iou on arm64 Linux - #9636
Widen float32 tolerance for TestRotatedBoxIou::test_iou on arm64 Linux#9636Ahmed8881 wants to merge 1 commit into
Conversation
The xyxyxyxy + float32 round-trip already special-cases macOS (atol=0.5) because Apple's vDSP sin/cos implementation rounds differently than the AVX backend used on x86_64, flipping the Graham scan's point ordering. The same thing happens with the NEON/Sleef backend on arm64 Linux (observed diff ~0.506), so extend the same tolerance there. Fixes pytorch#9499 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9636
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @Ahmed8881! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary
TestRotatedBoxIou::test_iou[xyxyxyxy-float32]fails on arm64 (aarch64) Linux with a max absolute difference of ~0.506, as reported inTestRotatedBoxIou::test_iou[xyxyxyxy-float32]fails on arm64 Linux due to float32 precision in format round-trip #9499.atol=0.5because Apple's vDSPsin/cosimplementation rounds differently than the AVX backend on x86_64, which is enough to flip the ordering used by the Graham scan in thexyxyxyxyround-trip.arm64/aarch64Linux viaplatform.machine().Fixes #9499
Test plan
python -c "import ast; ast.parse(open('test/test_ops.py').read())"— syntax check passesflake8 test/test_ops.py— no lint errorsTestRotatedBoxIou::test_iou[xyxyxyxy-float32-cpu]now passes (I don't have local access to an arm64 Linux machine to reproduce/verify directly)